import request from '@/router/axios'
import store from '@/store'
import { getLineName,getStationName} from "../../../../../api/subwayRat/commonCheck";
import fa from "element-ui/src/locale/lang/fa";
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  selection: true,
  searchLabelWidth:100,
  reserveSelection:false,
  addBtn: false,
  column: [
  // {
  //   fixed: true,
  //   label: '主键',
  //   prop: 'id',
  //   span: 24,
  //   hide: true
  // },
  {
    width: 100,
    hide: true,
    label: '线路',
    prop: 'lineCode',
    type: 'select',
    search: false,
    searchslot:true,
    cascaderItem: ["stationCode"],
    formatter: function(row, value , label, column){
      return getLineName(value);
    },
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getLineLists?userCode="+ store.getters.userInfo.userCode,
    display: true // 动态显隐控制不能删除
  }, {
    width: 180,
    hide: false,
    label: '站点',
    prop: 'stationCode',
    type: 'select',
    search: true,
    searchslot:true,
    formatter: function(row, value , label, column){
      return getStationName(row.lineCode,value);
    },
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getStationLists?userCode="+ store.getters.userInfo.userCode + "&lineCode={{key}}",
    display: true// 动态显隐控制不能删除
  },{
    label: '收入日期',
    prop: 'workDate',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    width: 100,
    type:'date',
    hide: false,
    search: true
  },{
    label: '售票员',
    prop: 'conductorName',
    searchslot : true,
    hide: false,
    search: true
  },{
    label: '售票员工号',
    prop: 'conductorCode',
    hide: false,
    search: true,
    searchslot : true
  },{
    label: '设备操作号',
    prop: 'deviceOperateNum',
    hide: false,
    search: false
  },{
    width: 130,
    label: 'BOM编号',
    prop: 'bomCode',
    hide: false,
    search: false
  },{    
    label: '值班站长工号',
    prop: 'entryUpdateJobNo',
    hide: true
  },{    
    label: '值班站长',
    prop: 'entryUpdateJobName',
    hide: true
  },{
    label: '状态',
    prop: 'auditStatus',
    type: 'select',
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    },
    dicData: [{
      label: '未审批',
      value: 1
    }, {
      label: '审批通过',
      value: 2
    }, {
      label: '审批未通过',
      value: 3
    }],
    search: true,
    searchValue: 1,
    hide: false,
  },
    {
      "type": "date",
      "label": "日期范围",
      "prop": "dates1",
      hide: true,
      search:true,
      searchRange: true,
      searchSpan: 12,
      width: 90,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dds',
    }
  ]
}

export function getSwStInputPassengerWork(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWork',
    method: 'post',
    params: param
  })
}
export function getSysUserToLine(param) {
  return request({
    url: '/check/check/getSysUserToLine',
    method: 'post',
    params: param
  })
}
export function auditAll(param) {
  return request({
    url: '/check/check/auditAll',
    method: 'post',
    params: param,
    data: param
  })
}

